<!--
 * @description 图片页脚组件
 * @date 2022/11/12
 -->
<template>
  <div class="img-footer-comp" :style="{ paddingTop, paddingBottom, 'margin-top': top, }">
    <div class="btMsg">

      <van-image v-if="bottomImg" :src="bottomImg" :fit="imgType" :style="{'height':height,'width':imgWidth}">
        <template v-slot:loading>
          <van-loading type="spinner" size="20" />
        </template>
      </van-image>
      <img v-else :style="{'height':height,'width':imgWidth}" src="./images/footer.png" alt="">
    </div>
  </div>
</template>

<script>
import mixins from './../mixins'

export default {
  name: 'ImgFooterComp',
  mixins: [mixins],
  props: {
    option: {
      type: Object,
      default: {}
    },
    isInitData: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      dataList: []
    }
  },
  computed: {
    height() {
      return this.px2rem(this.option.height || 110)
    },
    imgWidth() {
      return this.px2rem(this.option.imgWidth || 395)
    },
    bottomImg() {
      return this.option.bottomImg || ''
    }
  },
  created() {
    // if (this.isInitData) {
    //   this.initData()
    // }
  },
  methods: {
    setData(result) {
      this.dataList = JSON.parse(result.dataList.data.configValue)
    }
  }
}
</script>

<style scoped lang="scss">
@import '@/styles/var.scss';
@import '@/styles/utility/rem.scss';

.img-footer-comp {
  .btMsg {

    text-align: center;

    .van-image {
      width: 100%;
      height: 100%;

      .van-image__error {
        > img {
          width: rem(120);
          height: rem(120);
        }

      }
    }
  }
}
</style>
